package com.tanhua.manager.utils;


import com.tanhua.manager.domain.Admin;

public class AdminHolder {
    private static ThreadLocal<Admin> tl = new ThreadLocal<>();
    private static ThreadLocal<String> tokenTl = new ThreadLocal<>();


    public static void setToken(String token) {
        tokenTl.set(token);
    }

    public static String getToken() {
        return tokenTl.get();
    }

    public static void removeToken() {
        tokenTl.remove();
    }

    public static void setAdmin(Admin admin){
        tl.set(admin);
    }

    public static Admin getAdmin(){
      return tl.get();
    }

    public static void removeAdmin(){
        tl.remove();
    }

}
